﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using FourSquareAPI;

namespace FourSquareWM
{
    public partial class formCheckIn : Form
    {
        private FourSquare FourSquareConn;
        private venue venue;
        public formCheckIn(FourSquare F, venue V)
        {
            InitializeComponent();
            this.FourSquareConn = F;
            this.venue = V;
            this.labelCheckInTo.Text = V.Name;
        }

        private void menuItemOk_Click(object sender, EventArgs e)
        {
            checkin c = FourSquareConn.CheckinTo(venue.Id,null, this.checkBoxPrivate.Checked,null,null,null,null,null);
            string message = c.Message;
            if (c.Scoring.Count > 0)
            {
                foreach (score s in c.Scoring)
                {
                    message += "\r\n+" + s.Points + ": " + s.Message;
                }
            }
            MessageBox.Show(message);
            this.Close();
        }
    }
}